﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Roton.ZZT
{
    /// <summary>
    /// Interface used to interact with files and directory structures.
    /// </summary>
    interface IDisk
    {
        /// <summary>
        /// Change the current directory. The path is relative.
        /// </summary>
        /// <param name="relativeDirectory">The relative path to navigate to.</param>
        void ChangeDirectory(ByteString relativeDirectory);

        /// <summary>
        /// Retrieve a list of subdirectories in the current directory.
        /// </summary>
        ByteString[] GetDirectoryList();

        /// <summary>
        /// Retrieve a list of files in the current directory using a filter.
        /// </summary>
        /// <param name="filter">Filter to use when searching for files. For example: *.* returns every file.</param>
        ByteString[] GetFileList(ByteString filter);

        /// <summary>
        /// Load a file from the current directory.
        /// </summary>
        /// <param name="fileName">File name.</param>
        Stream LoadFile(ByteString fileName);

        /// <summary>
        /// Save a file to the current directory.
        /// </summary>
        /// <param name="fileName">File name.</param>
        /// <param name="data">Data to save.</param>
        /// <param name="length">Length of the data to save.</param>
        void SaveFile(ByteString fileName, Stream data, int length);
    }
}
